from multiprocessing import Process
import time
import os

def dance():
    while True:
        print("子进程, pid = {}, ppid = {}, 跳舞中..... ".format(os.getpid(), os.getppid()))
        time.sleep(1)

def sing():
    while True:
        print("子进程, pid = {}, ppid = {}, 唱歌中..... ".format(os.getpid(), os.getppid()))
        time.sleep(1)

if __name__ == '__main__':
    dance_process = Process(target=dance, name="dance")
    dance_process.start()
    sing_process = Process(target=sing)
    sing_process.start()






